<template lang="html">

  <self-header fixed :title="headerName" class="header">
    <img src="../assets/fanhui.png" slot="left" @click="back" />
  </self-header>
</template>

<script>
import {Header} from 'mint-ui';

export default {
  components: {
    'selfHeader': Header
  },
  data() {
    return {
      headerName: ''
    }
  },
  created() {
    console.log(this.$route.path)
    this.headerName = this.$route.name
  },
  methods: {
    back() {
      if (this.$route.path === '/business') {
        this.$router.push('/category')
      } else {
        this.$router.go(-1)
      }
    }
  }
}
</script>

<style lang="less" scoped>
.header {
  height: 50px;
  background: #048AB9;
  font-size: 20px;
}
img{
  width: 20px;
  height: 20px;
}
</style>
